<?php
/**
 * @author phuocndt
 * @copyright 2010
 */
 
?>
 <div class="chiasetitle">Tin tức</div>
<!--<div class="tintuctitle"></div>-->
 <ul class="sf-menu sf-vertical lmmid sf-js-enabled sf-shadow">
  <?php
  $news_query = tep_db_query("select * from content_category  order by order_");
  while($c= tep_db_fetch_array($news_query)){
    ?>
    <li ><a title="<?php echo $c['title'] ?>" href="news.php?catid=<?php echo $c['id']?>"><?php echo $c['title'] ?></a>
 </li>
    <?php
  }
  ?>
  </ul>
 <div class="chiasetitle">Chia sẻ</div>
 <ul class="sf-menu sf-vertical lmmid sf-js-enabled sf-shadow">
  <?php
  $news_query = tep_db_query("select * from content_category_  order by order_");
  while($c= tep_db_fetch_array($news_query)){
    ?>
    <li ><a title="<?php echo $c['title'] ?>" href="share.php?catid=<?php echo $c['id']?>"><?php echo $c['title'] ?></a>
 </li>
    <?php
  }
  ?>
  </ul>
<?php
  $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name,manufacturers_image from " . TABLE_MANUFACTURERS . " order by manufacturers_name limit 0,5 ");
  if ($number_of_rows = tep_db_num_rows($manufacturers_query)) {
?>

<!--<div class="lmpro"></div>-->
<div class="chiasetitle">Thương hiệu</div>

                <ul class="sf-menu sf-vertical lmmid sf-js-enabled sf-shadow">
<?php
    /**
 * $info_box_contents = array();
 *     $info_box_contents[] = array('text' => BOX_HEADING_MANUFACTURERS);

 *     new infoBoxHeading($info_box_contents, false, false);
 */

    if ($number_of_rows <= MAX_DISPLAY_MANUFACTURERS_IN_A_LIST) {
// Display a list
      $manufacturers_list = '';
      while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
        $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
        if (isset($HTTP_GET_VARS['manufacturers_id']) && ($HTTP_GET_VARS['manufacturers_id'] == $manufacturers['manufacturers_id'])) $manufacturers_name = '<b>' . $manufacturers_name .'</b>';
        $manufacturers_list .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id']) . '">' . $manufacturers_name . '</a><br>';
      }

      $manufacturers_list = substr($manufacturers_list, 0, -4);

      $info_box_contents = array();
      $info_box_contents[] = array('text' => $manufacturers_list);
    } else {
      $manufacturers_list = '';
      while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
        $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
        if (isset($HTTP_GET_VARS['manufacturers_id']) && ($HTTP_GET_VARS['manufacturers_id'] == $manufacturers['manufacturers_id'])) $manufacturers_name = '<b>' . $manufacturers_name .'</b>';
        $manufacturers_list .= '<li style="background: url(templates/phuocndt/images/lm-bullet_1.jpg) no-repeat scroll 0 0 transparent;\"><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id']) . '"><img src="images/'.$manufacturers['manufacturers_image'].'"/>&nbsp;&nbsp;' . $manufacturers_name . '</a></li>';
      }
        
        $widgets_query = tep_db_query("select * from ushop_widgets where area = 'left' and id=12 and published=1 order by ordering");
        $widgets = tep_db_fetch_array($widgets_query);
        //if($widgets){
        if(false){
            $manufacturers_list .= '<li style="background: url(templates/phuocndt/images/lm-bullet_1.jpg) no-repeat scroll 0 0 transparent;"><iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2Fushopvn%2F160457543998472&amp;width=190&amp;colorscheme=light&amp;connections=10&amp;stream=false&amp;header=true&amp;height=420" scrolling="no" frameborder="0" style=" width:190px; height:420px;" allowTransparency="true"></iframe></li>';
            //$manufacturers_list .= '<li><fb:like-box href="http://www.facebook.com/pages/ushopvn/160457543998472" width="190px" connections="10" stream="false" header="true"></fb:like-box></li>';            
        }
      //$manufacturers_list = substr($manufacturers_list, 0, -4);

      //$info_box_contents = array();
      //$info_box_contents[] = array('text' => $manufacturers_list);
      
      echo $manufacturers_list;  
// Display a drop-down
      /**
 * $manufacturers_array = array();
 *       if (MAX_MANUFACTURERS_LIST < 2) {
 *         $manufacturers_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);
 *       }

 *       while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
 *         $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
 *         $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],
 *                                        'text' => $manufacturers_name);
 *       }

 *       $info_box_contents = array();
 *       $info_box_contents[] = array('form' => tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get'),
 *                                    'text' => tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, (isset($HTTP_GET_VARS['manufacturers_id']) ? $HTTP_GET_VARS['manufacturers_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%"') . tep_hide_session_id());
 */
    }

    //new infoBox($info_box_contents);
?>

<li style="background:none;"><a style="background: none repeat scroll 0 0 transparent; color: #2BA7FA; text-align: right; text-decoration: underline;width: 155px;font-size:8pt;" href="manufacturer.php">Xem thêm</a></li>
</ul>
<!--<div class="lmpro" style="background: url(templates/phuocndt/images/menu-banchay.png);"></div>-->
<div class="chiasetitle">Hàng bán chạy</div>
<div class="lmmid" style="padding-right:17px;" >

 <marquee width="187" height="600" bgcolor="#FFFFFF" align="middle" name="mymarquee_hot" direction="up" scrolldelay="25" scrollamount="2" truespeed="truespeed" onmouseover="this.stop();" onmouseout="this.start();" id="mymarquee_hot">	
   <?php 
   $product_query = tep_db_query("select (select count(products_id) from orders_products where products_id=b.products_id) as total,b.*,a.products_image  from orders_products as b left join products as a on a.products_id=b.products_id order by total asc limit 0,10");
  while($c= tep_db_fetch_array($product_query)){
   ?>
    <div class="product" style="width: 187px;margin: 0px; float:none;">
        <div class="product-thumb">
            <a title="<?php echo $c['products_name'] ?>" href="product_info.php?cPath=78&amp;products_id=<?php echo $c['products_id'] ?>"><img width="160"  border="0" title="<?php echo $c['products_name'] ?>" alt="<?php echo $c['products_name'] ?>" src="images/<?php echo $c['products_image']  ?>"></a>
        
       
         
        </div>
         <div class="product-price">
             <?php echo $c['products_price'] ?> VNĐ        </div>
        
        <div class="product-tit">
            <a title="<?php echo $c['products_name'] ?>" href="<?php echo tep_href_link('product_info.php', 'products_id=' . $c['products_id'])  ?>"><?php echo $c['products_name'] ?></a>
        </div>  
    </div>
    <?php } ?>
 </marquee>
</div>

<?php
  }
  ?>

  <?php
  $supportonlines_query = tep_db_query("select name, nickname from support_online  order by id");
?>
<div class="chiasetitle">Hỗ trợ trực tuyến</div>
<!--<div class="lmpro" style="background: url(templates/phuocndt/images/menu-httt.png);"></div>-->
 <ul class="sf-menu sf-vertical lmmid sf-js-enabled sf-shadow">
 <?php while ($s= tep_db_fetch_array($supportonlines_query)) { ?>
 <li style="background: none;"><a title="<?php echo $s['name'] ?>" href="ymsgr:addfriend?<?php echo $s['nickname']?>"><img src="http://opi.yahoo.com/online?u=<?php echo $s['nickname']?>&m=g&t=2" border="0" alt="" width="120" height="30"></a>
 </li>
 <?php } ?>
 </ul>